-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade to a4 and add automatic-translations #3
base: main
Are you sure you want to change the base?
Conversation
@@ -17,7 +17,7 @@ async function go() { | |||
// your repo name followed by a -, however if you plan to use a | |||
// cheap Atlas cluster (below M10), you must use a unique prefix less | |||
// than 12 characters (before the -). | |||
shortNamePrefix: process.env.APOS_PREFIX || 'a3hpab-', | |||
shortNamePrefix: process.env.APOS_PREFIX || 'demo-local-', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a universal demo... how about skhosp-
?
@@ -21,9 +21,10 @@ | |||
"author": "Apostrophe Technologies", | |||
"license": "MIT", | |||
"dependencies": { | |||
"@apostrophecms-pro/automatic-translation": "^1.1.0", | |||
"@apostrophecms-pro/document-versions": "^1.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you missed a required upgrade here, see the table:
https://docs.apostrophecms.org/guide/migration/upgrading-3-to-4.html#how-to-upgrade-your-project
extendRestApiRoutes(self) { | ||
return { | ||
get: { | ||
'/locales': async (req) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the async
here as you're not doing anything async, so remove that.
I just PR'd the same route into core but it's OK to have this here too until that ships and it doesn't have to be removed immediately since it just replaces it with the same implementation.
@@ -0,0 +1,12 @@ | |||
module.exports = { | |||
// add a route to get all configured locales | |||
extendRestApiRoutes(self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be just apiRoutes
. restApiRoutes
is for implementing certain classic route patterns e.g. GET or POST straight to the module name like /api/v1/mymodulename
and so on. And extend...
functions are used only when you're interested in calling the original via _super
.
For this case just do apiRoutes
and it's otherwise correct.
… with new dashboard module
Summary
I wanted to record a quick video of translations working with this demo instance, so I upgraded to A4 and installed that module.
Here's the video.
What kind of change does this PR introduce?
(Check at least one)